<?php
function runner( $page_uri, $pass_vals ) {
  // important, it is assumed config is run first.
  // it may even be better to put it in the index, rather then the runner
  require_once '../view/' . $GLOBALS['__NAV_VIEW'][$page_uri] . '/' . $page_uri . '.php';

  require_once '../util/'.$GLOBALS['__NAV_UTIL']['timer'].'/timer.php';
  $stimer = mtimer();

  require_once '../util/'.$GLOBALS['__NAV_UTIL']['bitter'].'/bitter.php';

  global $__CFG;
  global $__PAGE_URI;

  $__PAGE_URI = parse_ini_file('../page_uri.ini',true);
  $tplVars = $__CFG;

  $data = $_REQUEST; 
  if( $pass_vals ) // then we're uri based and not $_GET based
    decode_uri( $data, $pass_vals, $__PAGE_URI[$page_uri] );

  // showPage loads our template vars and which template file we should use.
  // it is defined as a view page, that is included in the pretty.php loader(or index.php. The main loader page)
  showPage(&$tplName, &$tplVars, $data);
  showTpl($tplName, $tplVars);

  echo '<center>',mtimer( $stimer ),' with ',$GLOBALS['__QNUM'],' queries</center>';
}
?>
